#ifndef NETWORKEVENT_H_
#define NETWORKEVENT_H_

#include <cstddef>
#include <list>
#include <tr1/memory>

#include "Event.h"

class NetworkEvent : public Event
{
public:
    struct Header
    {
        Id code;
        long playerId;
        size_t sizeOfData;
    };

    virtual ~NetworkEvent();
    virtual void* getMessageBlob() = 0;
    virtual size_t getMessageBlobSize() = 0;

    static Header* allocateHeader(Id code, int playerId);

private:
    Header header;
};

typedef std::tr1::shared_ptr<NetworkEvent> NetworkEventPtr;
typedef std::list<std::pair<NetworkEventPtr,int> > NetworkEvents;

#endif
